package com.douqu.game.main.service;


import com.douqu.game.core.controller.PlayerController;
import com.douqu.game.core.database.model.LoginLogModel;
import com.douqu.game.core.database.model.LogoutLogModel;
import com.douqu.game.core.database.model.PlayerModel;
import com.douqu.game.core.database.model.UserModel;
import com.douqu.game.core.entity.Player;
import com.douqu.game.core.netty.NettyConnection;
import com.douqu.game.core.protobuf.SGCommonProto;
import com.douqu.game.core.web.request.RechargeParam;

import java.util.List;
import java.util.Map;

/**
 * Author : Bean
 * 2017-04-11 12:23
 */
public interface PlayerService {

    int update(Player player);

    int insert(PlayerModel playerModel);

    UserModel getUserByAccount(String account);

    PlayerModel getPlayerByIndex(String objectIndex);

    List<PlayerModel> getPlayerListByIndex(List<String> indexList);

    List<PlayerModel> getPlayerListByName(List<String> nameList);

    List<PlayerModel> getPlayerByUid(Integer uid);

    List<PlayerModel> getAllPlayerList();

    PlayerModel getPlayerByName(String name);

    void loginLog(LoginLogModel loginLogModel);

    void logoutLog(LogoutLogModel logoutLogModel);

    Player regist(String account, String nickName, String password, String avatar, SGCommonProto.E_CHANNEL_TYPE channel, SGCommonProto.E_CAMP_TYPE campType, String ip);

    void enterGame(PlayerController playerController, Player player, SGCommonProto.E_CHANNEL_TYPE channel, SGCommonProto.E_LOGIN_TYPE loginType, int serverRuleId ,String clientVersion,NettyConnection connection);

    void saveOnlinePlayer(boolean logout);

    void updatePlayers(List<Player> playerList, boolean updateBase, Class... clsList);

    void updatePlayer(Player player, boolean updateBase, Class... clsList);

    void updatePlayers(boolean updateBase, Class[] clsAry, Player... players);

    int getAllPlayerCount(String keyword);

    List<PlayerModel> getPlayerList(Integer page, Integer pageCount, String keyword);

    List<PlayerModel> findListByGroupMail(int camp , int minLevel, int maxLevel, int lastLoginDays);

    boolean recharge(PlayerController playerController, Player player, RechargeParam rechargeParam, int realRmb, String orderNo, String payType, boolean isTest);

    void updateMobile(String mobile,long uid);

    void updateAccount(String account,long uid);

    SGCommonProto.E_CAMP_TYPE getMinPlayerCountCampType();

    void feedBack(String playerIndex, String content);

    int getMyFCRank(int myFC);

    List<String> getRobotPlayerByMaxCount(int count);

    void deletePlayer(List<PlayerModel> playerList);

    Map<String, Object> getNameAvatarInfo(String playerIndex);

    int getWorldPlayerAverageLevel(int count, int functionId);

    void queryTotalRechargeCount(Player player, long activityStartTime, long activityEndTime);
}
